#pragma once

#define stage_inout clang::annotate("skr-shader", "stage_inout")
#define push_constant clang::annotate("skr-shader", "push_constant")
#define binding(binding, group) clang::annotate("skr-shader", "binding", (binding), (group))

#define compute_shader(x) clang::annotate("skr-shader", "stage", "compute", (x))
#define vertex_shader(x) clang::annotate("skr-shader", "stage", "vertex", (x))
#define fragment_shader(x) clang::annotate("skr-shader", "stage", "fragment", (x))

#define sv_position builtin("Position")
#define sv_clip_distance builtin("ClipDistance")
#define sv_cull_distance builtin("CullDistance")
#define sv_render_target(n) builtin("RenderTarget" #n)
#define sv_depth builtin("Depth")
#define sv_depth_ge builtin("DepthGreaterEqual")
#define sv_depth_le builtin("DepthLessEqual")
#define sv_stencil builtin("StencilRef")
#define sv_vertex_id builtin("VertexID")
#define sv_instance_id builtin("InstanceID")

#define sv_gs_instance_id builtin("GSInstanceID")
#define sv_tess_factor builtin("TessFactor")
#define sv_inside_tess_factor builtin("InsideTessFactor")
#define sv_domain_location builtin("DomainLocation")
#define sv_control_point_id builtin("ControlPointID")

#define sv_primitive_id builtin("PrimitiveID")
#define sv_is_front_face builtin("IsFrontFace")
#define sv_sample_id builtin("SampleIndex")
#define sv_sample_mask builtin("SampleMask")
#define sv_barycentric_coord builtin("Barycentrics")

#define sv_thread_id builtin("ThreadID")
#define sv_group_id builtin("GroupID")
#define sv_thread_position_in_group builtin("ThreadPositionInGroup")
#define sv_thread_index_in_group builtin("ThreadIndexInGroup")
#define sv_view_id builtin("ViewID")

#define interpolation(x) clang::annotate("skr-shader", "interpolation", (x))
#define linear interpolation("linear")
#define nointerpolation interpolation("nointerpolation")
#define centroid interpolation("centroid")
#define sample interpolation("sample")
#define noperspective interpolation("noperspective")